package com.xiayuanxing.arithmetic.ErCode;


import static com.xiayuanxing.arithmetic.ErCode.Utils.generateNumCode.generateNumCode;
import static com.xiayuanxing.arithmetic.ErCode.Utils.generateQRCode.generateQRCode;
import static com.xiayuanxing.arithmetic.ErCode.Utils.parseQRCode.parseQRCode;

/**
 * @program: arithmetic
 * @description:
 * @author: xia yuan xing
 * @create: 2021-10-09 11:06
 */
public class Test {


    public static void main(String[] args) {


        String text = generateNumCode(12);  //随机生成的12位验证码
//        System.out.println("随机生成的12位验证码为：" + text);
        int width = 100;    //二维码图片的宽
        int height = 100;   //二维码图片的高
        String format = "png";  //二维码图片的格式


        try {
            //生成二维码图片，并返回图片路径
            String pathName = generateQRCode(text, width, height, format);
            System.out.println("生成二维码的图片路径：" + pathName);


            String content = parseQRCode(pathName);
//            System.out.println("解析出二维码的图片的内容为：" + content);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}